"""
Author: Lucas
Date: 2024-05-11 12:44:14
LastEditors: Lucas
LastEditTime: 2024-05-11 12:44:16
Description: file content
"""

from openai import AzureOpenAI, OpenAI


def get_client(llm):
    if "gpt" in llm:
        print("Using OpenAI GPT")
        #   = OpenAI(
        #     # This is the default and can be omitted
        #     api_key=os.environ.get("OPENAI_API_KEY"),
        # )
        api_key = "d5bd5ca6e17f467d85ef8a07a72db835"
        api_version = "2023-12-01-preview"
        azure_endpoint = "https://gpt4-east-us2-1.openai.azure.com/"
        azure_deployment = "turbo"
        client = AzureOpenAI(
            api_key=api_key,
            api_version=api_version,
            azure_endpoint=azure_endpoint,
            azure_deployment=azure_deployment,
        )
    else:
        print(
            "Using local LLM, make sure you have installed Ollama (https://ollama.com/download) and have it running"
        )
        client = OpenAI(
            base_url="http://localhost:11434/v1",
            api_key="ollama",  # required, but unused
        )
    return client
